<template>
  <div class="app-container">
    <el-row>
      <el-col :span="12"><div ref="qujiaotime" style="height: 420px" /></el-col>
      <el-col :span="12"><div ref="qujiaofav" style="height: 420px" /></el-col>
    </el-row>
  </div>
</template>

<script>
import echarts from "echarts";

export default {
  name: "interest",
  data() {
    return {
      // classList:[],
      // // 查询参数
      // queryParams: {
      //   pageNum: 1,
      //   pageSize: 10,
      // },
      qujiaotime:null,
      qujiaofav:null,
    };
  },
  created() {
    //班级
    // this.getQueryClazzList();
    this.getList()
  },
  mounted() {

  },
  methods: {
    /****/
    async getList(){
      try {
          this.$nextTick(()=>{
            this.qujiaotime=echarts.init(this.$refs.qujiaotime);
            this.qujiaofav=echarts.init(this.$refs.qujiaofav);
            this.echartsqujiaotime()
            this.echartsqujiaofav()
          })
      }catch (e) {
        console.log(e)
      }
    },
    echartsqujiaotime(){
      this.qujiaotime.setOption({
        title: {
          text: '幼儿区角时长',
          x:'center',
          y:'top',
        },
        tooltip: {
          trigger: 'axis',
          axisPointer: {
            type: 'shadow'
          }
        },
        xAxis: {
          type: 'category',
          data:['区角1','区角2','区角3','区角4','区角5'],
          // axisLabel: { interval: 0, rotate: 30 }
        },
        yAxis: {
          type: 'value',
          axisLabel: {
            formatter: '{value} S'
          },
        },
        series: [
          {
            data:[100,200,80,150,50],
            type: 'bar',
            showBackground: false,
            barWidth:20,
            itemStyle: {
              normal: {
                //这里是颜色
                color: '#1088f8'
              }
            }
          }
        ]
      })
    },
    echartsqujiaofav(){
      this.qujiaofav.setOption({
        title: {
          text: '幼儿区角兴趣',
          x:'center',
          y:'top',
        },
        tooltip: {
          trigger: 'item'
        },
        radar: {
          shape: 'circle',
          indicator: [
            { name: '区角1', max: 50000 },
            { name: '区角2', max: 50000 },
            { name: '区角3', max: 50000 },
            { name: '区角4', max: 50000 },
            { name: '区角5', max: 50000 },
            { name: '区角6', max: 50000 }
          ],
          center:['50%',230],
          name: { // (圆外的标签)雷达图每个指示器名称的配置项。
            formatter: '{value}',
            textStyle: {
              fontSize: 15,
              color: '#428BD4'
            }
          },
          splitArea: {
            areaStyle: {
              color: ['#77EADF', '#26C3BE', '#64AFE9', '#428BD4'],
              shadowColor: 'rgba(0, 0, 0, 0.2)',
              shadowBlur: 10
            }
          },
          axisLine: {
            lineStyle: {
              color: 'rgba(211, 253, 250, 0.8)'
            }
          },
          splitLine: {
            lineStyle: {
              color: 'rgba(211, 253, 250, 0.8)'
            }
          },

        },
        series: [
          {
            // name: 'Budget vs spending',
            type: 'radar',
            data: [
              {
                value: [4200, 3000, 20000, 35000, 50000, 18000],
              },
              // {
              //   value: [5000, 14000, 28000, 26000, 42000, 21000],
              //   name: 'Actual Spending'
              // }
            ]
          }
        ]
      })
    },
    /** 查询班级列表 */
    // async getQueryClazzList() {
    //   try{
    //     this.loading = true;
    //     const {rows}=await selectClazz();
    //     this.classList=rows.map(item=>{
    //       return {
    //         id:item.id,
    //         label:item.title,
    //       }
    //     })
    //     this.loading = false;
    //   }catch (e) {
    //     console.log(e)
    //   }
    // },
  }
};
</script>
